import type { Entry } from "jmash-core";
import { reactive } from "vue";

// 启用禁用
export class RegionBizDict {
  values = reactive([] as Entry[]);
  query: any;

  constructor(results: any, query: any) {
    this.values.length = 0;
    this.values.push(...results.value);
    this.query = query;
  }
  // 根据给定键获取业务数据项的值的方法
  getValue(key: string): string {
    for (const obj of this.values) {
      if (obj.key == key) {
        return obj.value;
      }
    }
    return "";
  }
}
